#define dDo 262
#define dRe 294
#define dMi 330
#define dFa 349
#define dSol 392
#define dLa 440
#define dSi 494
#define Do 523
#define Re 587
#define Mi 659
#define Fa 698
#define Sol 784
#define La 880
#define Si 988
#define hDo 1046
#define hRe 1175
#define hMi 1318
#define hFa 1397
#define hSol 1568
#define hLa 1760
#define hSi 1967
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
#include <Arduino.h>
#include <SimpleFOC.h>
#include <FastLED.h>
#include "ESP32Tone.h"
int pin = 15; //自行选择作为输出的接口
int scale[] = {Do, Re, Mi, Fa, Sol, La, Si, dDo, dRe, dMi, dFa, dSol, dLa, dSi, hDo, hRe, hMi, hFa, hSol, hLa, hSi};
int pu[5] = {21,21,1,10,21};
int delay_ms[5] = {100,100,200,200,200};
int notone_delay_ms[] = {100,300,100,100,100};
void setup()
{
    pinMode(pin, OUTPUT);
}
void loop()
{
    for (int i = 0; i < 5; i++)
    {
        tone(pin, scale[pu[i] - 1]);
        delay(delay_ms[i]);
        noTone(pin);
        delay(notone_delay_ms[i]);
    }
    delay(5000);
}